﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;


namespace Number_System
{
    public partial class Form1 : Form
    {
    

        public Form1()
        {
            InitializeComponent();


        }




        private void button1_Click(object sender, EventArgs e)
        {
            if (box_first.TextLength == 10)
            {
                string number = box_first.Text;
                string temp = "";
                string temp2 = "";
                string newcell = "";

                temp = number.Substring(0, 3);
                temp2 = number.Substring(3, 7);

                switch (temp)
                {
                    case "072": newcell = "1 " + temp2; break;
                    case "082": newcell = "2 " + temp2; break;
                    case "083": newcell = "3 " + temp2; break;
                    case "073": newcell = "4 " + temp2; break;
                    case "084": newcell = "5 " + temp2; break;
                    case "076": newcell = "6 " + temp2; break;
                    case "078": newcell = "7 " + temp2; break;
                    case "074": newcell = "8 " + temp2; break;
                    case "079": newcell = "9 " + temp2; break;
                    case "012": newcell = "0 " + temp2; break;
                }
                lbl_Cell.Text = newcell;
            }
            else
            {
                MessageBox.Show("Must be 10 Digits");
            }
        }

        private void informationBindingNavigatorSaveItem_Click(object sender, EventArgs e)
        {
            this.Validate();
            this.informationBindingSource.EndEdit();
            this.tableAdapterManager.UpdateAll(this.table1);

        }

        private void Form1_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'table1.Information' table. You can move, or remove it, as needed.
            this.informationTableAdapter.Fill(this.table1.Information);

        }

    }
}
